import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import App from './App.vue'
import { createPinia } from 'pinia'
import { router } from './router'
import { i18n } from './i18n'
import 'virtual:svg-icons-register'

import '@/icons/iconfont/iconfont'
import 'element-plus/dist/index.css'
import '@/styles/index.scss'
import '@/styles/atom.scss'
import '@/styles/search-wrapper.scss'
import './tailwind.css'

import SvgIcon from '@/components/SvgIcon.vue'
import MyIcon from '@/components/my-icon/index.vue'
import MyIconSelect from '@/components/my-icon-select/index.vue'

const app = createApp(App)

// element plus图标 全局注册
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.component('SvgIcon', SvgIcon)
app.component('my-icon', MyIcon)
app.component('my-icon-select', MyIconSelect)

app.use(createPinia())

app.use(i18n)
app.use(router)
app.use(ElementPlus, {
  locale: zhCn,
})

app.mount('#app')
